package com.panshi.service.impl;

import com.panshi.entity.AppUserMassageT;
import com.panshi.entity.AppUserT;
import com.panshi.result.R;
import com.panshi.service.UserClientService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
public class UserClientServiceFallbackFactory implements FallbackFactory<UserClientService> {
    @Override
    public UserClientService create(Throwable cause) {
        System.out.println("服务降级------------- user");
        return new UserClientService() {


            @Override
            public List<AppUserMassageT> getUserMassage(int userId, int page) {
                return new ArrayList<>();
            }

            @Override
            public Boolean userMsgStatus(int id) {
                return false;
            }

            @Override
            public R login(AppUserT appUserT) {
                return  R.error();
            }

            @Override
            public List<AppUserT> all() {
                return new ArrayList<>();
            }

            @Override
            public AppUserT byid(Integer id) {
                return new AppUserT();
            }

            @Override
            public Boolean add(AppUserT appUserT) {
                return false;
            }

            @Override
            public Boolean memberStop(int id, String type) {
                return false;
            }

            @Override
            public Boolean del(Integer id) {
                return false;
            }

            @Override
            public Boolean upd(AppUserT appUserT) {
                return false;
            }

            @Override
            public R userUpdate(AppUserT appUserT) {
                return R.error();
            }

            @Override
            public List<AppUserT> getUserLikeName(String userNickname, int page, int limit) {
                return new ArrayList<>();
            }

            @Override
            public List<AppUserT> getUserPageAll(int page, int limit) {
                return new ArrayList<>();
            }


            @Override
            public R userAdd(String userName, String code, String userPassword,String type) {
                return R.error();
            }

            @Override
            public AppUserT getVeruser(String userBank,String userPassword) {
                return new AppUserT();
            }

            @Override
            public R reg(String type, String username,String form) {
                return R.error();
            }

            @Override
            public R findpwd(String username, String userpassword, String code, String type) {
                return R.error();
            }

            @Override
            public R userPhoneUpd(String userName, String code, int userId) {
                return R.error();
            }

            @Override
            public R userEmailUpd(String userName, String code, int userId) {
                return R.error();
            }

            @Override
            public Boolean userUpdatePwd(AppUserT appUserT) {
                return false;
            }

            @Override
            public Boolean userImgUpload(AppUserT appUserT) {
                return false;
            }


        };
    }
}
